package com.zsrt.day20170405.homework;

import java.util.Scanner;

/**
 * 打印空心菱形
 * @author zsrt
 *
 */

public class lingxing2 {
	public static void main(String[] args) {
		System.out.println("输入一个数字：");
		Scanner in=new Scanner(System.in);
		int h=in.nextInt();
		in.close();
		//菱形上部分
		for(int i=1;i<=h/2;i++){
			System.out.print(" ");
		}
		System.out.println("*");
		for(int i=1;i<=h/2;i++){
			for(int j=1;j<=(h/2-i);j++){
				System.out.print(" ");
			}
			System.out.print("*");
			for(int k=1;k<=2*i-1;k++){
				System.out.print(" ");
			}
			System.out.print("*");
			System.out.println();
		}
		
		//菱形下部分
		for(int i=1;i<=h/2-1;i++){
			for(int l=1;l<=i;l++){
				System.out.print(" ");
			}
			System.out.print("*");
			for(int j=1;j<=(h/2-i)*2-1;j++){
				System.out.print(" ");
			}
			System.out.print("*");
			System.out.println();
		}
		for(int i=1;i<=h/2;i++){
			System.out.print(" ");
		}
		System.out.println("*");
	}

}
